package main

import (
	"github.com/gin-gonic/gin"
	"github.com/spf13/pflag"
	"service/config"
	"service/model"
	"service/router"
)

var (
	cfg     = pflag.StringP("config", "c", "", "apiserver config file path.")

)


func main() {

	// init config
	if err := config.Init(*cfg); err != nil {
		panic(err)
	}

	gin.SetMode("debug")  //设置开发模式

	model.Init()  //初始数据库
	g:=gin.Default()

	router.Startup(g)


	g.Run(":8081")

}